package com.ruoyi.salarydetails.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.salarydetails.mapper.SalaryBreakdownMapper;
import com.ruoyi.salarydetails.domain.SalaryBreakdown;
import com.ruoyi.salarydetails.service.ISalaryBreakdownService;

/**
 * 薪资明细Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-12
 */
@Service
public class SalaryBreakdownServiceImpl extends ServiceImpl<SalaryBreakdownMapper, SalaryBreakdown> implements ISalaryBreakdownService {
    @Autowired
    private SalaryBreakdownMapper salaryBreakdownMapper;

    /**
     * 查询薪资明细
     *
     * @param id 薪资明细主键
     * @return 薪资明细
     */
    @Override
    public SalaryBreakdown selectSalaryBreakdownById(Long id) {
        return salaryBreakdownMapper.selectSalaryBreakdownById(id);
    }

    /**
     * 查询薪资明细列表
     *
     * @param salaryBreakdown 薪资明细
     * @return 薪资明细
     */
    @Override
    public List<SalaryBreakdown> selectSalaryBreakdownList(SalaryBreakdown salaryBreakdown) {
        return salaryBreakdownMapper.selectSalaryBreakdownList(salaryBreakdown);
    }

    /**
     * 新增薪资明细
     *
     * @param salaryBreakdown 薪资明细
     * @return 结果
     */
    @Override
    public int insertSalaryBreakdown(SalaryBreakdown salaryBreakdown) {
                salaryBreakdown.setCreateTime(DateUtils.getNowDate());
            return salaryBreakdownMapper.insertSalaryBreakdown(salaryBreakdown);
    }

    /**
     * 修改薪资明细
     *
     * @param salaryBreakdown 薪资明细
     * @return 结果
     */
    @Override
    public int updateSalaryBreakdown(SalaryBreakdown salaryBreakdown) {
                salaryBreakdown.setUpdateTime(DateUtils.getNowDate());
        return salaryBreakdownMapper.updateSalaryBreakdown(salaryBreakdown);
    }

    /**
     * 批量删除薪资明细
     *
     * @param ids 需要删除的薪资明细主键
     * @return 结果
     */
    @Override
    public int deleteSalaryBreakdownByIds(Long[] ids) {
        return salaryBreakdownMapper.deleteSalaryBreakdownByIds(ids);
    }

    /**
     * 删除薪资明细信息
     *
     * @param id 薪资明细主键
     * @return 结果
     */
    @Override
    public int deleteSalaryBreakdownById(Long id) {
        return salaryBreakdownMapper.deleteSalaryBreakdownById(id);
    }
}